<?php
class UtilMail{
	private $to;
	private $from;
	private $header;
	public $message;
	public $title;
	private $cc;
	function addReceiver($mail_address){
		if(strlen($this->to)>0){
			$this->to .= ",";
		}
		$this->to .= $mail_address;
	}
	function addCC($mail_address){
		if(strlen($this->cc)>0){
			$this->cc .=",";
		}
		$this->cc.=$mail_address;
	}
	function setSendFrom($mail_address){
		$this->from = $mail_address;
	}
	function send(){
		if(strlen($this->to)>0){
			if(strlen($this->title) == 0){
				$this->title = "No title";
			}
			$header = 'MIME-Version: 1.0' . "\r\n";
			$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
			if(strlen($this->to) > 0){
				$headers .= 'To: '.$this->to . "\r\n";
			}
			if(strlen($this->from) > 0){
				$headers .= 'From: '.$this->from . "\r\n";
			}
			if(strlen($this->cc)>0){
				$headers .= 'Cc: '.$this->cc . "\r\n";
			}
			if($this->message==null){
				$this->message = "";
			}
			mail($this->to,$this->title,$this->message,$headers);
		}else{
		}
	}
}
?>